﻿using STT.Layer.Connection;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace STT.Admin.WebForms
{
    public partial class ucTrangChu : System.Web.UI.UserControl
    {
        ToolBox tb = new ToolBox();
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                DataTable cnquyen = tb.GetDataTableById("TbDangNhap_GetCNQuyenByMaQuyen", Session["QuyenDN"].ToString());
                for (int i = 0; i < cnquyen.Rows.Count; i++)
                {
                    for (int j = 1; j < 56; j++)
                    {
                        if (cnquyen.Rows[i]["MaCN"].ToString() == "16")
                            ql16.Visible = true;
                        if (cnquyen.Rows[i]["MaCN"].ToString() == "19")
                            ql19.Visible = true;
                        if (cnquyen.Rows[i]["MaCN"].ToString() == "20")
                            ql20.Visible = true;
                        if (cnquyen.Rows[i]["MaCN"].ToString() == "24")
                            ql24.Visible = true;
                        if (cnquyen.Rows[i]["MaCN"].ToString() == "28")
                            ql28.Visible = true;
                        if (cnquyen.Rows[i]["MaCN"].ToString() == "33")
                            ql33.Visible = true;
                        if (cnquyen.Rows[i]["MaCN"].ToString() == "31")
                            ql31.Visible = true;
                        if (cnquyen.Rows[i]["MaCN"].ToString() == "32")
                            ql32.Visible = true;
                        if (cnquyen.Rows[i]["MaCN"].ToString() == "44")
                            ql44.Visible = true;
                        if (cnquyen.Rows[i]["MaCN"].ToString() == "40")
                            ql40.Visible = true;
                        if (cnquyen.Rows[i]["MaCN"].ToString() == "42")
                            ql42.Visible = true;
                        if (cnquyen.Rows[i]["MaCN"].ToString() == "36")
                            ql36.Visible = true;
                    }
                }
            }
            catch { }
        }
    }
}